﻿using Model;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace IService
{
    public interface ISysOrganizationService
    {
        /// <summary>
        /// 获取所有组织机构列表
        /// </summary>
        Task<List<SysOrganization>> GetAllAsync();

        /// <summary>
        /// 根据ID获取组织机构
        /// </summary>
        Task<SysOrganization> GetByIdAsync(long id);

        /// <summary>
        /// 新增组织机构
        /// </summary>
        Task<bool> AddAsync(SysOrganization organization);

        /// <summary>
        /// 编辑组织机构
        /// </summary>
        Task<bool> UpdateAsync(SysOrganization organization);

        /// <summary>
        /// 删除组织机构
        /// </summary>
        Task<bool> DeleteAsync(long id);

        /// <summary>
        /// 批量删除组织机构
        /// </summary>
        Task<bool> BatchDeleteAsync(List<long> ids);

        /// <summary>
        /// 按条件查询组织机构（名称/编码模糊搜索、状态筛选）
        /// </summary>
        Task<List<SysOrganization>> QueryAsync(string keyword, string status);
        // 新增异步方法
        Task<string> GenerateOrgCodeAsync(string prefix);

        Task<bool> CheckCodeExistsAsync(string code);

        Task<List<SysOrganization>> GetOrgTreeAsync();


    }
}